WIP: Prepare Unsigned integer types for SwiftKit#312
Closed
ktoso wants to merge 2 commits into
Closed
Conversation
ktoso
commented
Jul 14, 2025
| * @param bits bit value to store in this unsigned integer | ||
| * @return unsigned integer representation of the passed in value | ||
| */ | ||
| public static UnsignedByte representedByBitsOf(byte bits) { |
Collaborator
Author
There was a problem hiding this comment.
TODO: benchmark if it's worth it
Collaborator
Author
|
WIP towards resolving #307 |
Collaborator
Author
|
This is WIP and I need to confirm how to attribute Guava so we can reuse some of the nicer conversion logic UnsignedLong -> floating points etc. We'll do a NOTICE.txt but need to check how to attribute in specific files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using these we'll be able to use them to more safely express unsigned types, rather than just pretend it's all the same and fine when we import them into signed java types.
We'll also be able to offer extract mode that can just ignore this and extract as raw int/long etc, but these APIs may be safer